Repository navigation
fix(client): a read-only window draws no core menu write - #2264
Conversation
a815d69 to
cbd69b7
Compare
cbd69b7 to
dc5bca2
Compare
|
Written-by: Dev-3 @Birfy — please review and take #2264 into the merge queue at the current tip. Tip: dc5bca2 (tree 6c4714b8b9e9d17bbac53e4173ce85c8aae12d79, single parent = base 83d8105, the live main). 8 files, +336/−31. Label risk:T1; the draft flag is cleared and the PR is ready for review. A read-only FlyBot window no longer draws the Bot and group menu's core writes: Pin/Unpin, Duplicate, Make Main Bot, Remove Main Bot role, Hide from sidebar, Rename group, Delete, Delete group are dropped when the roster's Independent red-first on a clean 83d8105 tree with only the new test: 4 tests, 2 pass, 2 fail ( |
The Bot and group right-click menus painted Pin, Duplicate, Make Main Bot, Hide from sidebar, Rename group and Delete even when the roster said the window is read-only, and the host refuses every one of those endpoints, so the row only produced a failure toast. Compute one `locked` from `roster.readOnly` and drop those rows there, keeping the local and read-only entries. Refs ThinkFlowLab#2253.
|
Verdict: PASS at dc5bca2 Ran at this tip: Scope read at this tip: the change is the one gate in Red-first, one source file only: the tip's Generated files are consistent: Not run: the full |
Fixes #2253
Written-by: Dev3
Owner: Dev3
Reviewer: Reviewer
Base: 83d8105
Tree: 6c4714b8b9e9d17bbac53e4173ce85c8aae12d79
Verified commit: dc5bca2
Pushed head: dc5bca2
Scope
A read-only FlyBot window still draws the Bot and group right-click menu's core writes — Pin and Unpin, Duplicate, Make Main Bot, Remove Main Bot role, Hide from sidebar, Rename group, Delete and Delete group — although the host refuses every one of those endpoints, so each row only produces a failure toast. The menu now reads one
lockedflag from the roster'sreadOnlyand drops those rows there;Edit Bot,Group settings,Mark as UnreadandCopy conversation IDstay, and a writable window is unchanged.Files
core/src/client/context-menu.js— the gatecore/test/context-menu-readonly.test.js— the testdocs/subsystems/core-client.md— the owned docchangelog.d/2253-readonly-context-menu-writes.fixed.md— the fragmentcore/client.jsandpatches/ds-bot/**— generated from the aboveReady for review at the tip above.
Checkpoint
{
"pr": 2264, "claim": "Dev3", "issue": 2253,
"summary": "A read-only FlyBot window no longer draws the Bot and group right-click menu's core writes. The menu reads one locked flag from roster.readOnly (a string that trims to nothing is writable) and drops Pin/Unpin, Duplicate, Make Main Bot, Remove Main Bot role, Hide from sidebar, Rename group, Delete and Delete group. Edit Bot, Group settings, Mark as Unread and Copy conversation ID stay, and a writable window renders as before.",
"files": ["core/src/client/context-menu.js","core/test/context-menu-readonly.test.js","core/client.js","patches/ds-bot/0003-flybot-api-client.patch","patches/ds-bot/0008-client-bundle.patch","patches/ds-bot/files/test/context-menu-readonly.test.js","docs/subsystems/core-client.md","changelog.d/2253-readonly-context-menu-writes.fixed.md"],
"checks": { "ran": "cd core && node --import ./test/harness-resolve.mjs --test test/context-menu-readonly.test.js", "result": "green", "at": "dc5bca201c7cd90e29d6781cba72787c7420b8f2" },
"next": "none — ready for review"
}